package mobilesmil.userinterface;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;

/**
 * 34 x 34 pixel square {@link Drawable} with a white border used by {@link GeneralPropsFormActivity} to display
 * the user's chosen background color.
 * @author Ryan Ware
 *
 */
public class BackgroundColorBox extends Drawable {
	
	private Paint mBackgroundPaint = new Paint();
	private Paint mBorderPaint = new Paint();

	/**
	 * Construct the {@link Drawable} to display a color.
	 * @param bgColor color to be displayed in the box
	 */
	public BackgroundColorBox(int bgColor) {
		mBackgroundPaint.setColor(bgColor);
		mBorderPaint.setColor(Color.WHITE);
	}
	
	@Override
	public void draw(Canvas canvas) {
		canvas.drawRect(0, 0, 34, 34, mBorderPaint);
		canvas.drawRect(1, 1, 33, 33, mBackgroundPaint);
	}

	@Override
	public int getOpacity() {
		return 0;
	}

	@Override
	public void setAlpha(int arg0) {}

	@Override
	public void setColorFilter(ColorFilter arg0) {}

}
